package com.minimalist.common.entity.lindi.po;

import com.minimalist.common.config.mybatis.InsertFullColumnHandler;
import com.minimalist.common.config.mybatis.UpdateFullColumnHandler;
import com.minimalist.common.config.mybatis.bo.BaseEntity;
import com.mybatisflex.annotation.Table;

import java.io.Serial;
import java.io.Serializable;
import java.time.LocalDateTime;

/**
 * 林地指标平台_购买指标记录表 实体类。
 *
 * @author 11987
 * @since 2025-05-12
 */
@Table(value = "LINDI_PURCHASE_INDEX_RECORD", onInsert = InsertFullColumnHandler.class, onUpdate = UpdateFullColumnHandler.class)
public class LindiPurchaseIndexRecord extends BaseEntity implements Serializable{

    @Serial
    private static final long serialVersionUID = 1L;

    /**
     * 购买指标记录ID
     */
    private Long purchaseIndexRecordId;

    /**
     * 编号
     */
    private String purchaseIndexRecordCode;


    /**
     * 购买时间
     */
    private LocalDateTime purchaseTime;

    /**
     * 备注
     */
    private String remark;

    public LindiPurchaseIndexRecord(){
    }

    public LindiPurchaseIndexRecord(Long purchaseIndexRecordId, String purchaseIndexRecordCode, LocalDateTime purchaseTime, String remark){
        this.purchaseIndexRecordId = purchaseIndexRecordId;
        this.purchaseIndexRecordCode = purchaseIndexRecordCode;
        this.purchaseTime = purchaseTime;
        this.remark = remark;
    }

    public Long getPurchaseIndexRecordId(){
        return purchaseIndexRecordId;
    }

    public void setPurchaseIndexRecordId(Long purchaseIndexRecordId){
        this.purchaseIndexRecordId = purchaseIndexRecordId;
    }

    public String getPurchaseIndexRecordCode(){
        return purchaseIndexRecordCode;
    }

    public void setPurchaseIndexRecordCode(String purchaseIndexRecordCode){
        this.purchaseIndexRecordCode = purchaseIndexRecordCode;
    }



    public LocalDateTime getPurchaseTime(){
        return purchaseTime;
    }

    public void setPurchaseTime(LocalDateTime purchaseTime){
        this.purchaseTime = purchaseTime;
    }

    public String getRemark(){
        return remark;
    }

    public void setRemark(String remark){
        this.remark = remark;
    }

    public static LindiPurchaseIndexRecordBuilder builder(){
        return new LindiPurchaseIndexRecordBuilder();
    }

    @Override
    public boolean equals(Object o){
        if (this == o){
            return true;
        }
        if (o == null || getClass() != o.getClass()){
            return false;
        }
        if (!super.equals(o)){
            return false;
        }
        LindiPurchaseIndexRecord that = (LindiPurchaseIndexRecord) o;
        return java.util.Objects.equals(purchaseIndexRecordId, that.purchaseIndexRecordId) &&
                java.util.Objects.equals(purchaseIndexRecordCode, that.purchaseIndexRecordCode) &&
                java.util.Objects.equals(purchaseTime, that.purchaseTime) &&
                java.util.Objects.equals(remark, that.remark);
    }

    @Override
    public int hashCode(){
        return java.util.Objects.hash(super.hashCode(), purchaseIndexRecordId, purchaseIndexRecordCode, purchaseTime, remark);
    }

    public static class LindiPurchaseIndexRecordBuilder{
        private Long purchaseIndexRecordId;
        private String purchaseIndexRecordCode;
        private LocalDateTime purchaseTime;
        private String remark;

        public LindiPurchaseIndexRecordBuilder purchaseIndexRecordId(Long purchaseIndexRecordId){
            this.purchaseIndexRecordId = purchaseIndexRecordId;
            return this;
        }

        public LindiPurchaseIndexRecordBuilder purchaseIndexRecordCode(String purchaseIndexRecordCode){
            this.purchaseIndexRecordCode = purchaseIndexRecordCode;
            return this;
        }



        public LindiPurchaseIndexRecordBuilder purchaseTime(LocalDateTime purchaseTime){
            this.purchaseTime = purchaseTime;
            return this;
        }

        public LindiPurchaseIndexRecordBuilder remark(String remark){
            this.remark = remark;
            return this;
        }

        public LindiPurchaseIndexRecord build(){
            return new LindiPurchaseIndexRecord(purchaseIndexRecordId, purchaseIndexRecordCode, purchaseTime, remark);
        }
    }

}
